// ReportServer.cpp : Defines the initialization routines for the DLL.
//

#include "stdafx.h"
#include "ReportServer.h"
#include "ConDataBase.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

//
//TODO: If this DLL is dynamically linked against the MFC DLLs,
//		any functions exported from this DLL which call into
//		MFC must have the AFX_MANAGE_STATE macro added at the
//		very beginning of the function.
//
//		For example:
//
//		extern "C" BOOL PASCAL EXPORT ExportedFunction()
//		{
//			AFX_MANAGE_STATE(AfxGetStaticModuleState());
//			// normal function body here
//		}
//
//		It is very important that this macro appear in each
//		function, prior to any calls into MFC.  This means that
//		it must appear as the first statement within the 
//		function, even before any object variable declarations
//		as their constructors may generate calls into the MFC
//		DLL.
//
//		Please see MFC Technical Notes 33 and 58 for additional
//		details.
//

// CReportServerApp

BEGIN_MESSAGE_MAP(CReportServerApp, CWinApp)
END_MESSAGE_MAP()


// CReportServerApp construction

CReportServerApp::CReportServerApp()
{
	// TODO: add construction code here,
	// Place all significant initialization in InitInstance
}


// The one and only CReportServerApp object

CReportServerApp theApp;


// CReportServerApp initialization

BOOL CReportServerApp::InitInstance()
{
	CWinApp::InitInstance();

	if (!AfxSocketInit())
	{
		AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
		return FALSE;
	}

	return TRUE;
}

extern "C" int InitConfig()
{
	return CConDataBase::InitConfig(theApp.m_hInstance);
}


extern "C" int DealWithType()
{
	return 100;
}
//
//
//extern "C" int StringSplit(const char * split)
//{
//	CConDataBase::g_SplitStr = split;
//	return 0;
//}
//

extern "C" int InterfaceFun(std::map<int,std::string> & Interface)
{
	Interface[01] = ("GetStringData");
	Interface[02] = ("GetBufferData");
	Interface[10] = ("GetSqlData");
	Interface[50] = ("ExcStringData");
	Interface[51] = ("ExcBufferData");
	Interface[60] = ("ExcSqlData");
	return 0;
}

extern "C" bool GetStringData(SOCKET socketclient,SOCKET socketwatch)
{
	return CConDataBase::GetStringData(socketclient,socketwatch);
}

extern "C" bool GetBufferData(SOCKET socketclient,SOCKET socketwatch)
{
	return CConDataBase::GetBufferData(socketclient,socketwatch);
}

extern "C" bool GetSqlData(SOCKET socketclient,SOCKET socketwatch)
{
	return CConDataBase::GetSqlData(socketclient,socketwatch);
}

extern "C" bool ExcStringData(SOCKET socketclient,SOCKET socketwatch)
{
	return CConDataBase::ExcStringData(socketclient,socketwatch);
}

extern "C" bool ExcBufferData(SOCKET socketclient,SOCKET socketwatch)
{
	return CConDataBase::ExcBufferData(socketclient,socketwatch);
}

extern "C" bool ExcSqlData(SOCKET socketclient,SOCKET socketwatch)
{
	return CConDataBase::ExcSqlData(socketclient,socketwatch);
}